#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1


int main() {
    int seed = 1000;
    int numPlayer = 2;
    int r;
	int loopCnt = 10; //how many loops I want to test this over and over
    int k[10] = {adventurer, council_room, feast, gardens, mine
               , remodel, smithy, village, baron, great_hall};
    struct gameState G;
 	int theResult, i;
	int handPos = 4;
	int card = smithy;
	int choice1 = 0;
	int choice2 = 0;
	int choice3 = 0;
	int bonus = 0;
	int numCards;
	
	#if (NOISY_TEST ==1)
		printf ("TESTING smithy_case():\n");
	#endif

	for(i=0; i<loopCnt; i++) {
					
		memset(&G, 23, sizeof(struct gameState));   // clear the game state
		r = initializeGame(numPlayer, k, seed, &G); // initialize a new game

		theResult = cardEffect(card, choice1, choice2, choice3, &G, handPos, &bonus);//the number of the switch to use 
				
		numCards = *G.handCount;
		
		#if (NOISY_TEST == 1)
			printf("number of cards = %d, expected = %d\n", numCards, 7); //Smithy adds +3 to cards, and the game starts fresh with 4 cards
		#endif
			
		assert(numCards == 7); // check if the number of cards is correct
	}	
	
	printf("All tests passed!\n");

    return 0;
}
